/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Modelo;

import java.security.*;
import javax.swing.JOptionPane;

/**
 *
 * @author felipe
 */
public class Funciones {

    public static String md5(String string) {
        try {
            MessageDigest messageDigest = MessageDigest.getInstance("MD5");
            byte[] hash = messageDigest.digest(string.getBytes("UTF-8"));
            StringBuilder builder = new StringBuilder(2 * hash.length);
            for (byte b : hash) {
                builder.append(String.format("%02x", b & 0xff));
            }
            return builder.toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    
    public static void mensaje(String mensaje){
        JOptionPane.showMessageDialog(null, mensaje);
    }

}
